﻿using MoreEvent.Common.Players;
using MoreEvent.Common.Systems;
using System.Linq;
using Terraria;
using Terraria.ModLoader;

namespace MoreEvent.Content.Biomes
{
    public class Aurora : ModBiome
    {
        public override int Music => MusicLoader.GetMusicSlot(Mod, "Assets/Music/Aurora");
        public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
        public override bool IsBiomeActive(Player player)
        {
            if (!Main.dedServ && player.whoAmI == Main.myPlayer)
            {
                int type = player.GetModPlayer<EventPlayer>().GetAuroraType();
                if (type != -1)
                {
                    player.GetModPlayer<EventPlayer>().SetLocalAurora(type);
                }
                player.ManageSpecialBiomeVisuals("MoreEvent:AuroraSky", Main.LocalPlayer.GetModPlayer<EventPlayer>().InLocalAurora);
            }
            return EventSystem.ActiveEvents.Contains(7);
        }
    }
}
